Skip to content

perf(redis): use sorted set index for O(log N) schedule claiming#14

Open
isimisi wants to merge 1 commit into
boringnode:mainfrom
Juristic:feat/zset-due-index
Open

perf(redis): use sorted set index for O(log N) schedule claiming#14
isimisi wants to merge 1 commit into
boringnode:mainfrom
Juristic:feat/zset-due-index

Conversation

@isimisi
Copy link
Copy Markdown

@isimisi isimisi commented May 15, 2026

explanation: #13 (comment)

@RomainLanz
Copy link
Copy Markdown
Member

Hi!

Thanks for the PR.

We need a migration path for existing Redis users before merging this.

With this change, claimDueSchedule() only reads from the new schedules::due ZSET, but users upgrading from the current version will only have the existing schedule hashes plus schedules::index. Those schedules will never be claimed until something manually rewrites them or calls backfillDueIndex().

Can we make the migration automatic/idempotent, or expose and document a required migration step? For example, on startup or first claim, backfill schedules::due from schedules::index for active schedules with next_run_at.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants